package com.barbeque.mall.service.wx;

import com.barbeque.mall.bean.goods.MarketGoodsProduct;
import com.barbeque.mall.bean.goods.MarketGoodsProductExample;
import com.barbeque.mall.mapper.MarketGoodsProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 苏东宇
 * @since 2022/07/21 15:25
 */
@Service
public class WxProductServiceImpl implements WxProductService{

    @Autowired
    MarketGoodsProductMapper marketGoodsProductMapper;
    /**
     * 根据goodsid找 product信息
     * @param id
     * @return com.barbeque.mall.bean.goods.MarketGoodsProduct
     * @author 苏东宇
     * @since 2022/07/21 17:11
     */
    @Override
    public List<MarketGoodsProduct> getProductByGoodsId(Integer id) {
        MarketGoodsProductExample marketGoodsProductExample = new MarketGoodsProductExample();
        MarketGoodsProductExample.Criteria criteria = marketGoodsProductExample.createCriteria();
        criteria.andGoodsIdEqualTo(id);
        criteria.andDeletedEqualTo(false);

        List<MarketGoodsProduct> marketGoodsProducts = marketGoodsProductMapper.selectByExample(marketGoodsProductExample);


        return marketGoodsProducts;
    }




}
